package com.letu.core.point;

import com.letu.core.context.ContextUtil;
import com.letu.core.context.StaticContextUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Map;

@Data
public class BasePoint implements Serializable {
    /**
     * 操作人id
     */
    @ApiModelProperty(value = "操作人id")
    private Long userId = ContextUtil.getUserId();

    /**
     * 操作人名称
     */
    @ApiModelProperty(value = "操作人名称")
    private String userName = ContextUtil.getName();

    /**
     * 埋点时间
     */
    @ApiModelProperty(value = "埋点时间")
    private  Long createTime = System.currentTimeMillis();

    /**
     * 链路追踪id
     */
    @ApiModelProperty(value = "链路追踪id")
    private String trace = ContextUtil.getTrace();

    /**
     * IP地址
     */
    @ApiModelProperty(value = "IP地址")
    private String ipAddr = StaticContextUtil.getIpAddr();


    /**
     * header 数据
     */
    private Map<String,Object> headerMap;
}
